package vo

import (
	"gluenet/internal/glue-srvp/domain/po"
	"time"
)

type ConfigInfoRes struct {
	ID         int64       `json:"id"`
	Name       string      `json:"name"`
	Kind       string      `json:"kind"`
	Property   string      `json:"property"`
	Describe   string      `json:"describe"`
	Version    string      `json:"version"`
	DetailInfo interface{} `json:"detail_info"`
	Created    time.Time   `json:"create_time"`
	Updated    time.Time   `json:"update_time"`
}

type TagInfoRes struct {
	TagID            string `json:"tag_id"`
	TagValue         string `json:"tag_value"`
	TagDescribe      string `json:"tag_describe"`
	TagGroupID       string `json:"tag_group_id"`
	TagGroupValue    string `json:"tag_group_value"`
	TagGroupDescribe string `json:"tag_group_describe"`
}

type TagDetailInfo struct {
	ID       string    `json:"id"`
	GroupID  string    `json:"group_id"`
	Value    string    `json:"value"`
	Describe string    `json:"describe"`
	Created  time.Time `json:"created"`
	Updated  time.Time `json:"updated"`
	Deleted  time.Time `json:"deleted"`
}

type TagGroupRes struct {
	TagGroupID       string `json:"tag_group_id"`
	TagGroupValue    string `json:"tag_group_value"`
	TagGroupDescribe string `json:"tag_group_describe"`
}

type TagObjRes struct {
	TagID   string `json:"tag_id"`
	ObjID   string `json:"obj_id"`
	ObjType string `json:"obj_type"`
}

type TagObjDetailRes struct {
	Configs   []interface{} `json:"configs"`
	Instances []interface{} `json:"instances"`
}

type AllTagObjRes struct {
	TagID            string          `json:"tag_id"`
	TagValue         string          `json:"tag_value"`
	TagDescribe      string          `json:"tag_describe"`
	TagGroupID       string          `json:"tag_group_id"`
	TagGroupValue    string          `json:"tag_group_value"`
	TagGroupDescribe string          `json:"tag_group_describe"`
	TagObjs          TagObjDetailRes `json:"tag_objs"`
}

type InstanceInfoRes struct {
	GUID             string      `json:"guid"`
	Name             string      `json:"name"`
	ConfigID         string      `json:"config_id"`
	Label            string      `json:"label"`
	Version          string      `json:"version"`
	Describe         string      `json:"describe"`
	Platform         string      `json:"platform"`
	Origin           string      `json:"origin"`
	Kind             string      `json:"kind"`
	Links            interface{} `json:"links"`
	DetailRepoValue  interface{} `json:"detail_value"`
	RunTimeRepoValue interface{} `json:"runtime_value"`
	Created          time.Time   `json:"create_time"`
	Updated          time.Time   `json:"update_time"`
}

type InstanceRuntimeRes struct {
	GUID           string  `json:"guid"`
	Name           string  `json:"name"`
	Platform       string  `json:"platform"`
	Version        int64   `json:"version"`
	Describe       string  `json:"describe"`
	UsedCores      float64 `json:"used_cores"`
	AvgMemUsed     float64 `json:"avg_mem_used"`
	ErrorLogsCount int64   `json:"error_logs_count"`
	RunningTime    float64 `json:"running_time"`
	//AppPodsInfo map[string]interface{} `json:"pods_detail"`
}

type AgentRuntimeRes struct {
	GUID         string  `json:"guid"`
	ClusterName  string  `json:"cluster_name"`
	Platform     string  `json:"platform"`
	ClusterNodes int     `json:"cluster_nodes"`
	AreaCountry  string  `xorm:"area_country"`
	AreaProvince string  `xorm:"area_province"`
	AreaCity     string  `xorm:"area_city"`
	AreaCounty   string  `xorm:"area_county"`
	Cores        float64 `json:"cluster_cores"`
	MemSize      float64 `json:"cluster_memsize"`
	CpuUsage     float64 `json:"cpu_usage"`
	MemUsage     float64 `json:"mem_usage"`
	//LogsWarn		 int			`json:"logs_warn"`
	//LogsError		 int			`json:"logs_error"`
	//LogsInfo		 int			`json:"logs_info"`
	RunningTime      int64              `json:"running_time"`
	ClusterNodesInfo []po.AgentNodeInfo `json:"hosts_detail"`
}

type AgentRuntimeResV2 struct {
	GUID        string `json:"guid"`
	ClusterName string `json:"name"`
	Platform    string `json:"platform"`
	Hosts       int    `json:"hosts"`
	Area        string `json:"area"`
	//AreaCountry  string  `xorm:"area_country"`
	//AreaProvince string  `xorm:"area_province"`
	//AreaCity     string  `xorm:"area_city"`
	//AreaCounty   string  `xorm:"area_county"`
	Cores    float64 `json:"cluster_cores"`
	MemSize  float64 `json:"cluster_memsize"`
	CpuUsage float64 `json:"cpu_usage"`
	MemUsage float64 `json:"mem_usage"`
	//LogsWarn		 int			`json:"logs_warn"`
	//LogsError		 int			`json:"logs_error"`
	//LogsInfo		 int			`json:"logs_info"`
	RunningTime int64 `json:"running_time"`
	//ClusterNodesInfo []po.AgentNodesInfo `json:"hosts_detail"`
}

type AgentRegisterRes struct {
	Guid   string      `json:"guid"`
	Config interface{} `json:"config"`
}

type HelmConfigInfo struct {
}

type LinkSetRes struct {
	Links []interface{} `json:"links"`
}

type AgentRuntimeChild struct {
	Guid        string                    `json:"guid"`
	ClusterName string                    `json:"cluster_name"`
	Nodes       map[string]*AgentNodeInfo `json:"nodes"`
}

type AgentNodeInfo struct {
	NodeName string `json:"node_name"`
	CpuCores string `json:"cpu_cores"`
	MemSize  string `json:"mem_size"`
}

type InstanceRuntimeChild struct {
	Guid      string                      `json:"guid"`
	AgentGuid string                      `json:"agent_guid"`
	AppName   string                      `json:"app_name"`
	Property  string                      `json:"property"`
	Pods      map[string]*InstancePodInfo `json:"pods"`
}

type InstancePodInfo struct {
	PodName       string                            `json:"pod_name"`
	PodService    string                            `json:"pod_service"`
	PodContainers map[string]*InstanceContainerInfo `json:"pod_containers"`
}

type InstanceContainerInfo struct {
	ContainerName  string `json:"container_name"`
	ContainerFlame string `json:"container_flame"`
}

type RepoRes struct {
	Id       int64     `json:"id"`
	Name     string    `json:"name"`
	Describe string    `json:"describe"`
	Version  int64     `json:"version"`
	Kind     string    `json:"kind"`
	Url      string    `json:"url"`
	User     string    `json:"user"`
	AuthType string    `json:"auth_type"`
	Created  time.Time `json:"created"`
	Updated  time.Time `json:"updated"`
}
